import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 评论信息
 */
@Entity('community_comment')
export class CommunityCommentEntity extends BaseEntity {
  @Column({ comment: '内容', type: 'text' })
  content: string;

  @Index()
  @Column({ comment: '帖子ID' })
  postId: number;

  @Index()
  @Column({ comment: '评论人ID' })
  userId: number;

  @Column({ comment: '评论人昵称', nullable: true })
  nickName: string;

  @Column({ comment: '时间', type: 'datetime' })
  commentTime: Date;

  @Column({ comment: '点赞数', default: 0 })
  likeCount: number;
}
